package com.itheima.controller;

import com.itheima.pojo.ClazzReportData;
import com.itheima.pojo.EmpGender;
import com.itheima.pojo.EmpJobReportData;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 数据统计管理
 */
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Resource
    private ReportService reportService;

    /**
     * 员工职位统计
     * @return
     */
    @GetMapping("/empJobData")
    public Result empJobData(){
        EmpJobReportData empJobData = reportService.empJobData();
        return Result.success(empJobData);
    }

    /**
     *员工性别统计
     */
    @GetMapping("/empGenderData")
    public Result empGender(){
        List<EmpGender> empGenders = reportService.empGender();
        return Result.success(empGenders);
    }

    /**
     * 班级人数统计
     */
    @GetMapping("/studentCountData")
    public Result stuClazz(){
        ClazzReportData Datas = reportService.StuClazz();
        return Result.success(Datas);
    }

    /**
     * 学员学历统计
     */
    @GetMapping("/studentDegreeData")
    public Result stuDegree(){
        List<EmpGender> Dates = reportService.stuDegree();
        return Result.success(Dates);
    }


}
